﻿<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<title>问答答题卡</title>
	<meta name="format-detection" content="telephone=no" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="viewport"
		content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
	<meta name="description" content="">
	<meta name="keywords" content="">

	<link href="statics/risk_test.css" rel="stylesheet" />

	<link href="statics/Fytx_Tips.css" rel="stylesheet" type="text/css" />

</head>

<body style="background-color:#1ea8c7">

	<div class="wrapper">
		<div id="answer" class="card_wrap">

			<!--Q1-->
			<!-- <div class="card_cont card1">
				<div class="card">
					<p class="question"><span>Q1、</span>室温：10～30℃。阴凉处：不超过20℃。凉暗处：遮光并且温度不超过20℃。冷处是指2～10℃。故本题选择D。<br />题库维护负责人：LWS室温：10～30℃。阴凉处：不超过20℃。凉暗处：遮光并且温度不超过20℃。冷处是指2～10℃。故本题选择D。<br />题库维护负责人：LWS</p>
					<ul class="select">
						<li>
							<input id="1_1" type="radio" name="r-group-1">
							<label for="1_1">除存款</label>
						</li>
						<li>
							<input id="1_2" type="radio" name="r-group-1">
							<label for="1_2">大部分</label>
						</li>
						<li>
							<input id="1_3" type="radio" name="r-group-1">
							<label for="1_3">资产均衡地</label>
						</li>
						<li>
							<input id="1_4" type="radio" name="r-group-1">
							<label for="1_4">大部分投资 </label>
						</li>
					</ul>
					<div class="jieshi">
						<p>答案:xxx</p>
						<p>函数说明 slice() 方法可通过指定的开始和结束位置,提取字符串的某个部分,并以新的字符串返回被提取的部分。 语法如下: string.slice(start, end);
							start(必需):规定从何处开始选取。</p>
					</div>
					<div class="card_bottom"><a class="prev">下一题</a><span><b>1</b>/9</span></div>
				</div>
			</div> -->

		</div>
	</div>

	<script src="statics/jquery-1.8.3.min.js"></script>
	<script src="statics/answer.js"></script>

	<!--配置样式（也可以默认使用）-->
	<script type="text/javascript" src="statics/Fytx_Tips_Config.js"></script> 
	<!--美化脚本程序-->
	<script type="text/javascript" src="statics/Fytx_Tips.js"></script>
	
	<script src="../js/url.js"></script>

	<script>
		 window.onload = function () {
            var url = location.search; //获取url中"?"符后的字串
            var theRequest = new Object();
            if (url.indexOf("?") != -1) {
                var str = url.substr(1); //substr()方法返回从参数值开始到结束的字符串；
                var strs = str.split("&");
                for (var i = 0; i < strs.length; i++) {
                    theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1]);
                }
                // console.log("参数", theRequest); //此时的theRequest就是我们需要的参数；
				RandTopics(theRequest.data)
				$.getdata();
            }
        }
	

		function RandTopics(url) {
				$.ajax({
				url: $.url+"/yj/answer/"+url,
				dataType: "json",
				type: "get",
				async: '',
				data: {},
				success: function (res) {
					if (res.code == 0) {
						var data = res.data;
						for (var i = 0; i < data.length; i++) {
				var lists = '<div class="card_cont card'+(i+1)+'">'+
					'<div class="card">'+
						'<p class="question"><span>Q'+(i+1)+'、</span>'+(data[i].topic)+'</p>'+
						'<ul class="select">'+
							'<li><input id="'+data[i].id+'_1" type="radio" name="r-group-'+i+'">'+
								'<label for="'+data[i].id+'_1">'+data[i].questionone+'</label></li>'+
								'<li><input id="'+data[i].id+'_2" type="radio" name="r-group-'+i+'">'+
									'<label for="'+data[i].id+'_2">'+data[i].questiontow+'</label></li>'+
									'<li><input id="'+data[i].id+'_3" type="radio" name="r-group-'+i+'">'+
										'<label for="'+data[i].id+'_3">'+data[i].questionthree+'</label></li>'+
										'<li><input id="'+data[i].id+'_4" type="radio" name="r-group-'+i+'">'+
											'<label for="'+data[i].id+'_4">'+data[i].questionfour+'</label></li>'+
											'<li><input id="'+data[i].id+'_5" type="radio" name="r-group-'+i+'">'+
												'<label for="'+data[i].id+'_5">'+data[i].questionfive+'</label></li></ul>'+
											'<div class="jieshi">'+
												'<p>答案:第'+data[i].answer+'个</p>'+
												'<p>'+data[i].explain+'</p></div>'
												if(i == data.length){
													lists += '<div class="card_bottom"><span><b>'+(i+1)+'</b>/'+data.length+'</span></div></div></div>'
												}else{
													lists += '<div class="card_bottom"><a class="prev">下一题</a><span><b>'+(i+1)+'</b>/'+data.length+'</span></div></div></div>'
												}
							$("#answer").append(lists);
						}
					} else {
						$(document).ready(function () {
							$.alert("提示信息", "请求错误，请联系我");
						});
					}
				},
				error: function (res) {
					console.log(res);
				}
			});	
		}

	</script>
</body>

</html>